package com.ftg.shopping.shopcar.controller;

import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.shopcar.entity.sp_cartshop;
import com.ftg.shopping.shopcar.service.shopcarService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/shopcar")
@Api("这是后台购物车展示和删除")
public class shopcarController {

    @Autowired
    shopcarService shopcarService;

    @GetMapping("/show")
    @ApiOperation("这是后台购物车展示信息")
    public LayuiPage<sp_cartshop> showall(int page,int limit){
        return shopcarService.showAll4(page,limit);
    }

    @DeleteMapping("/delete")
    @ApiOperation("这是后台购物车删除信息")
    public int deleteshopcar(int id){
        return shopcarService.deleteshopcar(id);
    }
}
